home *** CD-ROM | disk | FTP | other *** search
- '**************************************************************************
- '* Attica Installation Program
- '* D.K. 13/8/92 - modified from SAMPLE1.MST
- '* JMS 12/1/94
- '* JMS 22/02/94 ....AND FROM SAMPLE2.MST
- '**************************************************************************
-
- '' *** $DEFINE DEBUG ''Define for script development/debugging
- ''$DEFINE DEBUG
-
- '$INCLUDE 'setupapi.inc'
- '$INCLUDE 'msdetect.inc'
- '$INCLUDE 'myfuncts.inc'
-
- ''Dialog ID's
- CONST WELCOME = 100
- CONST ASKQUIT = 200
- CONST DESTPATH = 300
- CONST EXITFAILURE = 400
- CONST EXITQUIT = 600
- CONST EXITSUCCESS = 700
- CONST OPTIONS = 800
- CONST OPTIONHELP = 950
- CONST DLG_MINIMUM = 6400
- CONST CUSTINST = 6200
- CONST DLG_STANDARD = 6100
- CONST TOOBIG = 6300
- CONST DLG_COMPLETE = 6500
- CONST DLG_DISABLED = 6700
-
- ''Attica specific Dialog ID's
- CONST SINGLE_ID = 1000
- CONST ADMIN_ID = 1001
- CONST NETWORK_ID = 1002
-
- GLOBAL WINDIR$ ''Windows Directory
- GLOBAL SYSDIR$ ''System Directory
- GLOBAL DEST$ ''destination directory.
- GLOBAL SOURCE$ ''Source Directory
- GLOBAL OPTIONAL$
- GLOBAL TITLE$ ''Title of dialog box
- GLOBAL COPYRIGHT$ ''Copyright string
- GLOBAL ROMDRIVE$
- GLOBAL HIDECD$ ''"TRUE" means hide cd-drive in single user installation
- GLOBAL ADDPATH$ ''"ON" or "OFF"
- GLOBAL ADDGROUP$ ''"ON" or "OFF"
- GLOBAL NEWGROUP$ ''group to add to program manager
- GLOBAL ITEMEXE$ ''the .exe file to be executed
- GLOBAL TEMPDIR$ ''where the setup files are
- GLOBAL CUSTOM$
- GLOBAL CMPCOPY$
- GLOBAL newopt$
- GLOBAL INFO$ '' which section of setup.ini to read
- GLOBAL INF_FILE$ '' name of setup .inf file to use
- GLOBAL DLGPROC$ '' which dialog procedure to call
- GLOBAL DLG_ID% '' which dialog box to use
-
- GLOBAL INSMODE$ '' Installation mode
- GLOBAL SECTION$
- GLOBAL INIFILES$ '' .ini files those require changes
- GLOBAL Ini$ '' Full path for temporary setup.ini
- GLOBAL BACKGROUND$ '' Dll contains Background bitmap
- GLOBAL SUBDIR$ '' Subdirectories after Dest directory
- GLOBAL Win$
- GLOBAL Sys$
- GLOBAL DATASOURCE$
- GLOBAL IMAGESOURCE$
-
- CONST VAR_MAX% = 6
- GLOBAL VarNames$(VAR_MAX%) '' 1 -- Variable names
- GLOBAL VarValues$(VAR_MAX%) '' 2 -- Sub. Strings
-
- ''File Types
- CONST MINIMUM = 1
- CONST STANDARD = 2
- CONST COMPLETE = 3
-
- GLOBAL WINDRIVE$ ''Windows drive letter.
-
- ''CustInst list symbol names
- GLOBAL APPNEEDS$ ''Option list costs per drive
- GLOBAL DBNEEDS$
- GLOBAL IMAGENEEDS$
- GLOBAL EXTRACOSTS$ ''List of extra costs to add per drive
- GLOBAL mincost&
- GLOBAL stdcost&
- GLOBAL compcost&
- global newcost&
- GLOBAL free&
-
- ''Dialog list symbol names
- GLOBAL STATUSTEXT$
- GLOBAL DRIVETEXT$
-
- DECLARE SUB AddOptFilesToCopyList (ftype%)
- DECLARE SUB RecalcOptFiles (ftype%)
- DECLARE SUB RecalcPath
- DECLARE SUB SetDriveStatus (List$)
- DECLARE SUB Install
- DECLARE FUNCTION MakePath (szDir$, szFile$) AS STRING
- DECLARE SUB AddSectFilesToCopyList (szSect$, szSrc$, szDest$)
- DECLARE FUNCTION InitializeInstall LIB "mscuistf.dll" ( hInst%, hWnd% ) AS INTEGER
- DECLARE FUNCTION SubVariables( szString$ ) AS STRING
- DECLARE FUNCTION FindOptions( szString$ ) AS STRING
- ''***********************************************************************************
- ''***********************************************************************************
-
- INIT:
-
- CUIDLL$ = "mscuistf.dll" ''Custom user interface dll
- HELPPROC$ = "FHelpDlgProc" ''Help dialog procedure
- SECTION$ = "Info Custom"
-
- '$IFDEF DEBUG
- OpenLogFile MakePath("C:\temp\", "LOGFILE.OUT"), 0
- '$ENDIF ''DEBUG
-
- ret% = InitializeInstall (hinstFrame(), HwndFrame()) ''max window
-
- TEMPDIR$ = GetSymbolValue("STF_SRCINFPATH")
-
- IF TEMPDIR$ = "" THEN
- TEMPDIR$ = GetSymbolValue("STF_CWDDIR")
- END IF
-
-
- ''*******************************************************************
- '' set up mode dependant info - single, admin or network:
- '' STF_MODE$ is initialised by _mstest from the command line options
- ''*******************************************************************
-
- INSMODE$ = GetSymbolValue("STF_MODE")
-
- SELECT CASE INSMODE$
-
- CASE "NETWORK"
- INFO$ = "Info Net"
- ADDPATH$ = "OFF"
- ADDGROUP$ = "ON"
- GetLocalHardDrivesList "Drives"
- DLGPROC$ = "NetInstallDlgProc"
- DLG_ID% = NETWORK_ID
-
- CASE "ADMIN"
- INFO$ = "Info Admin"
- ADDPATH$ = "OFF"
- ADDGROUP$ = "OFF"
- GetNetworkDrivesList "Drives"
- DLGPROC$ = "AdminInstallDlgProc"
- DLG_ID% = ADMIN_ID
-
- CASE ELSE
- INFO$ = "Info Single"
- ADDPATH$ = "ON"
- ADDGROUP$ = "ON"
- GetLocalHardDrivesList "Drives"
- DLGPROC$ = "SingleInstallDlgProc"
- DLG_ID% = SINGLE_ID
- INSMODE$ = "SINGLE"
- END SELECT
-
-
- ''*******************************************************
- '' READ FROM SETUP.INI : product-dependent names
- ''*******************************************************
-
- Ini$ = TEMPDIR$ + "setup.ini"
-
- WINDIR$ = GetWindowsDir()
- SYSDIR$ = GetWindowsSysDir()
- NEWGROUP$ = GetIniKeyString( Ini$, INFO$, "GroupName" )
- ITEMEXE$ = GetIniKeyString( Ini$, INFO$, "ExeFiles" )
- INF_FILE$ = GetIniKeyString( Ini$, INFO$, "InfFile" )
- INIFILES$ = GetIniKeyString( Ini$, INFO$, "IniFiles" )
- HIDECD$ = GetIniKeyString( Ini$, INFO$, "HideCD" )
- SUBDIR$ = GetIniKeyString( Ini$, INFO$, "SubDir" )
-
- CUSTOM$ = GetIniKeyString( Ini$, SECTION$, "CustomOptions" )
- CMPCOPY$ = GetIniKeyString( Ini$, SECTION$, "CompleteCopy" )
- DATASOURCE$ = GetIniKeyString( Ini$, SECTION$, "DataFiles" )
- IMAGESOURCE$ = GetIniKeyString( Ini$, SECTION$, "ImageFiles")
-
-
-
- ''************************************************************
- '' Set background bitmap: if no special dll, use mscuistf.dll
- ''************************************************************
-
- BACKGROUND$ = GetIniKeyString( Ini$, INFO$, "BkFile" )
- IF BACKGROUND$ = "" THEN
- BACKGROUND$ = CUIDLL$
- LOGO% = 108
- ELSE
- LOGO% = 1
- ENDIF
-
- SetBitmap BACKGROUND$, LOGO%
-
- ''*************************************************************
- '' Nice Friendly Welcome to Setup Box
- ''*************************************************************
-
- WELCOME:
- sz$ = UIStartDlg(CUIDLL$, 100, "FInfodlgProc", 900, HELPPROC$)
-
- UIPop 1
- if sz$ = "EXIT" then
- GOSUB ASKQUIT
- end if
-
- ''*******************************************************
- '' default entries for the main dialog box:
- ''*******************************************************
-
-
- IF INSMODE$ = "NETWORK" THEN
- DEST$ = WINDIR$
- ELSE
- DEST$ = GetListItem("Drives", 1) + ":\" + GetIniKeyString( Ini$, INFO$, "DestDir" )
- END IF
-
-
- SOURCE$ = GetSymbolValue( "STF_SRCDIR" )
- ROMDRIVE$ = GetRomDrive
- TITLE$ = GetIniKeyString( Ini$, INFO$, "Title" )
- SetTitle TITLE$
-
- COPYRIGHT$ = GetIniKeyString( Ini$, INFO$, "Copyright1" )
- COPYRIGHT$ = COPYRIGHT$+CHR$(10)+GetIniKeyString( Ini$, INFO$, "Copyright2" )
- COPYRIGHT$ = COPYRIGHT$+CHR$(10)+GetIniKeyString( Ini$, INFO$, "Copyright3" )
-
-
- ''***************************************************************
- ''READ FILES OUT OF INF FILE LIST
- ''***************************************************************
-
- SetSymbolValue "Title", TITLE$
- SetSymbolValue "Copyright", COPYRIGHT$
- SetSymbolValue "SourcePath", SOURCE$
- SetSymbolValue "DestPath", DEST$
- SetSymbolValue "RomDrive", ROMDRIVE$
- SetSymbolValue "AddPath", ADDPATH$
- SetSymbolValue "AddGroup", ADDGROUP$
- SetSymbolValue "HideRomDrive", HIDECD$
-
-
- ''**********************************************************************
- '' Call dialog with path names & add group/path options. Store values.
- ''**********************************************************************
-
- GETPATH:
- sz$ = UIStartDlg(CUIDLL$, DLG_ID%, DLGPROC$, 900, HELPPROC$ )
-
- UIPop 1
- IF sz$ = "CANCEL" THEN
- GOSUB ASKQUIT
- GOTO GETPATH
- END IF
-
-
- SOURCE$ = GetSymbolValue( "SourcePath" )
- DEST$ = GetSymbolValue( "DestPath" )
- ROMDRIVE$ = GetSymbolValue( "RomDrive" )
- ADDPATH$ = GetSymbolValue( "AddPath" )
- ADDGROUP$ = GetSymbolValue( "AddGroup" )
-
-
- If CUSTOM$ = "ON" Then
- OPTIONAL$ = DEST$
- Else
- OPTIONAL$ = ROMDRIVE$ + ":\"
- End if
-
- ''***********************************************************
- '' Initialise substitute run-time variables
- ''***********************************************************
-
- VarNames$(0) = "[ROMDRIVE]"
- VarValues$(0) = ROMDRIVE$ + ":\"
-
- VarNames$(1) = "[DEST]"
-
- IF INSMODE$ = "SINGLE" THEN
- VarValues$(1) = DEST$
- ELSE
- VarValues$( 1 ) = SOURCE$
- END IF
-
- VarNames$(2) = "[SOURCE]"
- VarValues$(2) = SOURCE$
-
-
- VarNames$(3) = "[WINDIR]"
- VarValues$(3) = WINDIR$
-
-
- VarNames$(4) = "[SYSDIR]"
- VarValues$(4) = SYSDIR$
-
- VarNames$(5) = "[OPTIONAL]"
- VarValues$(5) = OPTIONAL$
-
-
- IF INSMODE$ = "SINGLE" THEN
- Win$ = WINDIR$
- Sys$ = SYSDIR$
- ELSEIF INSMODE$ = "ADMIN" THEN
- Win$ = DEST$
- Sys$ = DEST$
- ELSE
- Win$ = DEST$
- Sys$ = SYSDIR$
- END IF
-
- '$ifdef DEBUG
- WriteToLogFile "Directories (Dest,Win,Sys): "+DEST$+", "+Win$+", "+Sys$
- '$endif ''DEBUG
-
- ''********************************************************
- ''Read Inf file & initialise symbols for options dialog box
- ''********************************************************
-
- szInfRead$ = TEMPDIR$ + INF_FILE$
- ReadInfFile szInfRead$
-
-
- STATUSTEXT$ = "StatusItemsText"
- DRIVETEXT$ = "DriveStatusText"
-
- FOR i% = 1 TO 3 STEP 1
- AddListItem STATUSTEXT$, ""
- NEXT i%
-
- FOR i% = 1 TO 7 STEP 1
- AddListItem DRIVETEXT$, ""
- NEXT i%
-
- ReplaceListItem DRIVETEXT$, 7, DEST$
-
- ''Disk cost list symbols
- APPNEEDS$ = "AppNeeds"
- DBNEEDS$ = "DbaseNeeds"
- IMAGENEEDS$ = "ImageNeeds"
- EXTRACOSTS$ = "ExtraCosts"
-
- FOR i% = 1 TO 26 STEP 1
- AddListItem EXTRACOSTS$, "0"
- NEXT i%
-
- WINDRIVE$ = MID$(GetWindowsDir, 1, 1)
-
- sz$ = UIStartDlg(CUIDLL$, 6600, "FModelessDlgProc", 0, "")
-
- RecalcPath
-
- UIPop 1
-
- '*************************************************************************
- '** Recalculates disk space and sets option status info according
- '** to the current destination path.
- '*************************************************************************
-
- SUB RecalcPath STATIC
-
- CursorSave% = ShowWaitCursor()
-
- RecalcOptFiles MINIMUM
- RecalcOptFiles STANDARD
- RecalcOptFiles COMPLETE
-
- RestoreCursor CursorSave%
-
- END SUB
-
- '*************************************************************************
- '** Recalculates disk space for the given option files and sets
- '** the status info symbol "StatusItemsText".
- '*************************************************************************
-
- SUB RecalcOptFiles (ftype%) STATIC
-
-
- CursorSave% = ShowWaitCursor()
- ClearCopyList
- AddOptFilesToCopyList ftype%
- fExtra% = 0
-
-
- IF ftype% = MINIMUM THEN
- ListSym$ = APPNEEDS$
-
- ELSEIF ftype% = STANDARD THEN
- ListSym$ = DBNEEDS$
-
- ELSEIF ftype% = COMPLETE THEN
- ListSym$ = IMAGENEEDS$
- END IF
-
- ''Add extra cost to Windows drive for ini/progman, etc.
-
- ndrive% = ASC(ucase$(WINDRIVE$)) - ASC("A") + 1
- ReplaceListItem EXTRACOSTS$, ndrive%, "10240"
- fExtra% = 1
-
- StillNeed& = GetCopyListCost(EXTRACOSTS$, ListSym$, "")
- cost& = 0
- FOR i% = 1 TO 26 STEP 1
- cost& = cost& + VAL(GetListItem(ListSym$, i%))
- NEXT i%
-
- ReplaceListItem STATUSTEXT$, ftype%, STR$(cost& / 1024) + " K"
-
- IF ftype% = MINIMUM THEN
- mincost& = cost&
- ELSEIF ftype% = STANDARD THEN
- stdcost& = cost&
- ELSE
- compcost& = cost&
- END IF
-
- IF fExtra% THEN
- ReplaceListItem EXTRACOSTS$, ndrive%, "0"
- END IF
-
- SetDriveStatus ListSym$
- RestoreCursor CursorSave%
- ListSym$ = ""
-
- END SUB
-
- ''******************************************************************************
- ''Call Options install dialog box & process messages
- ''******************************************************************************
-
- CUSTINST:
-
- If CUSTOM$ = "ON" Then
- SetSymbolValue "RadioDefault", "2"
-
- If CMPCOPY$ = "ON" Then
- SetSymbolValue "CustomEnable", "YES"
- Else
- SetSymbolValue "CustomEnable", "NO"
- End If
-
- sz$ = UIStartDlg(CUIDLL$, CUSTINST, "OptionsInstallDlgProc", OPTIONHELP, HELPPROC$)
-
- Else
- sz$ = "CONTINUE"
-
- End If
-
- newopt$ = GetSymbolValue("ButtonChecked")
-
- if newopt$ = "1" then
- newcost& = mincost&
- elseif newopt$ = "3" then
- newcost& = compcost&
- else
- newcost& = stdcost&
- end if
-
- Select Case sz$
-
- Case "CONTINUE" ''Install only if it will fit.
-
- If newcost& > free& then
- GOSUB TOOBIG
- ERROR STFERR
- end if
-
- UIPop 1
- GOTO MSINSTALL
-
-
- Case "EXIT"
- GOSUB ASKQUIT
- GOTO CUSTINST
-
- Case "CANCEL"
- UIPop 1
- GOTO GETPATH
-
- Case "CHK1"
- RecalcOptFiles MINIMUM
- GOTO CUSTINST
-
- Case "CHK2"
- RecalcOptFiles STANDARD
- GOTO CUSTINST
-
- Case "CHK3"
- RecalcOptFiles COMPLETE
- GOTO CUSTINST
-
- Case "BTN1"
- GOSUB INFO1
- GOTO CUSTINST
-
- Case "BTN2"
- GOSUB INFO2
- GOTO CUSTINST
-
- Case "BTN3"
- GOSUB INFO3
- GOTO CUSTINST
-
- Case "REACTIVATE"
- RecalcPath
- GOTO CUSTINST
-
- Case Else
- GOSUB ASKQUIT
- GOTO CUSTINST
-
- End Select
-
-
- ''**************************************************************
- '' Tidy Up
- ''**************************************************************
-
- RemoveSymbol "Title"
- RemoveSymbol "Copyright"
- RemoveSymbol "SourcePath"
- RemoveSymbol "DestPath"
- RemoveSymbol "RomDrive"
- RemoveSymbol "AddPath"
- RemoveSymbol "AddGroup"
- RemoveSymbol "ButtonChecked"
- RemoveSymbol "CustomEnable"
- RemoveSymbol "RadioDefault"
-
- ''**************************************************************
- '' call install procedure
- ''**************************************************************
-
- MSINSTALL:
-
- AddToBillboardList CUIDLL$, 5000, "FModelessDlgProc", 10
- Install
- UIPop 1
-
-
-
-
- ''************************************************************************
- '** Adds the specified option files to the copy list.
- '*************************************************************************
-
- SUB AddOptFilesToCopyList (ftype%) STATIC
-
- If ftype% = MINIMUM or ftype% = STANDARD or ftype% = COMPLETE Then
-
- AddSectFilesToCopyList "Network Win Files", SOURCE$, Win$
- AddSectFilesToCopyList "Network Sys Files", SOURCE$, Sys$
-
- If INSMODE$ = "SINGLE" or INSMODE$ = "ADMIN" THEN
-
- AddSectFilesToCopyList "Single Win Files", SOURCE$, Win$
- AddSectFilesToCopyList "Single Sys Files", SOURCE$, Sys$
-
- End If
-
- IF INSMODE$ = "ADMIN" THEN
- AddSectFilesToCopyList "Admin Win Files", SOURCE$, Win$
- AddSectFilesToCopyList "Admin Sys Files", SOURCE$, Sys$
- END IF
-
- End If
-
- If ftype% = STANDARD or ftype% = COMPLETE Then
-
-
- AddSectFilesToCopyList "Network Files", SOURCE$, DEST$
-
- IF INSMODE$ = "SINGLE" OR INSMODE$ = "ADMIN" THEN
-
- AddSectFilesToCopyList "Single Files", SOURCE$, DEST$
-
- count% = 1
- subcur$ = GetNthFieldFromIniString( SUBDIR$, count% )
-
- WHILE subcur$ <> ""
- AddSectFilesToCopyList "Single " + subcur$ + " Files", SOURCE$, DEST$ + subcur$ + "\"
- count% = count% + 1
- subcur$ = GetNthFieldFromIniString( SUBDIR$, count% )
- WEND
-
- END IF
-
- IF INSMODE$ = "ADMIN" THEN
- AddSectFilesToCopyList "Admin Files", SOURCE$, DEST$
- END IF
-
- End If
-
- If ftype% = COMPLETE Then
-
- AddSectFilesToCopyList "Database Files", SOURCE$, DEST$
- AddSectFilesToCopyList "Image Files", SOURCE$, DEST$
-
- End If
- END SUB
-
- '***************************************************************************
- '** Purpose:
- '** Sets drive status info according to latest disk space calcs.
- '*************************************************************************
-
- SUB SetDriveStatus (List$) STATIC
-
- drive$ = MID$(DEST$, 1, 1)
- ndrive% = ASC(ucase$(drive$)) - ASC("A") + 1
- newcost& = VAL(GetListItem(List$, ndrive%))
- free& = GetFreeSpaceForDrive(drive$)
- ReplaceListItem DRIVETEXT$, 1, drive$ + ":"
- ReplaceListItem DRIVETEXT$, 2, STR$(newcost& / 1024) + " K"
- ReplaceListItem DRIVETEXT$, 3, STR$(free& / 1024) + " K"
- END SUB
-
- '*************************************************************************
- ''** Appends a file name to the end of a directory path,
- '** inserting a backslash character as needed.
- '*************************************************************************
-
- FUNCTION MakePath (szDir$, szFile$) STATIC AS STRING
- IF szDir$ = "" THEN
- MakePath = szFile$
- ELSEIF szFile$ = "" THEN
- MakePath = szDir$
- ELSEIF MID$(szDir$, LEN(szDir$), 1) = "\" THEN
- MakePath = szDir$ + szFile$
- ELSE
- MakePath = szDir$ + "\" + szFile$
- END IF
- END FUNCTION
-
- ''*************************************************************************
- '' Bastardised version of AddSectionFilesToCopyList
- '' that does nothing if the section does not exist
- ''*************************************************************************
-
- SUB AddSectFilesToCopyList (szSect$, szSrc$, szDest$) STATIC
-
- szInf$ = TEMPDIR$ + INF_FILE$
-
- if DoesIniSectionExist( szInf$, szSect$) then
-
- IF FAddSectionFilesToCopyList (szSect$, szSrc$, szDest$) = 0 THEN
-
- '$ifdef DEBUG
- WriteToLogFile "AddSectFilesToCopyList: "+szSect$+", "+szSrc$+", "+szDest$+", "+szInf$
- WriteToLogFile "Checking for ini file section : "+szSect$+" "
- '$endif ''DEBUG
-
- ERROR STFERR
- END IF
-
- end if
-
- END SUB
-
- ''***********************************************
- '' This function subsitutes pre-defined
- '' variables with their run-time values
- ''***********************************************
-
- FUNCTION SubVariables( szString$ ) STATIC AS STRING
-
-
- DIM pos%, lastpos%
- DIM Temp$
-
- FOR I% = 0 TO VAR_MAX - 1 STEP 1
-
- lastpos% = 0
- pos% = INSTR( 1, szString$, VarNames$( I% ) )
-
- WHILE pos% > lastpos%
-
- lastpos% = Len( VarNames$( I% ) ) + pos%
- Temp$ = MID$( szString$, 1, pos% - 1 )
- Temp$ = Temp$ + VarValues$( I% )
- Temp$ = Temp$ + MID$( szString$, lastpos%, Len( szString$ ) - lastpos% + 1 )
- lastpos% = pos% + Len( VarValues$( I% ) )
- szString$ = Temp$
- pos% = InStr( lastpos%, szString$, VarNames$( I% ) )
-
- WEND
-
- NEXT I%
-
- SubVariables$ = szString$
-
- END FUNCTION
-
- '**************************************************************************
- ''Search for an optional copyable file on the cd, and return the path only
- '**************************************************************************
-
- FUNCTION FindOptions( szString$ ) STATIC AS STRING
-
- src$ = FindFileInTree(szString$, ROMDRIVE$ + ":\")
- If src$ = "" Then
- i% = DoMsgBox(szString$ + " is not found on the CD", "Setup Error", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- Else
- pos% = InStr(1, UCASE$(src$), UCASE$(szString$))
- src$ = MID$(src$, 1, pos% - 1)
- End If
-
- FindOptions = src$
-
- END FUNCTION
-
- '************************************************************************
- '** Purpose:
- '** Builds the copy list and performs all installation operations.
- '*************************************************************************
-
- SUB Install STATIC
-
- CursorSave% = ShowWaitCursor()
- CreateDir DEST$, cmoNone
-
- ClearCopyList
-
- If newopt$ = "1" Then
- AddOptFilesToCopyList MINIMUM
- Elseif newopt$ = "3" Then
- AddOptFilesToCopyList COMPLETE
- Else
- AddOptFilesToCopyList STANDARD
- End If
-
- SetCopyGaugePosition 20, 175
-
- RestoreCursor CursorSave%
-
- '$ifdef DEBUG
- DumpCopyList "c:\temp\copy.out"
- '$endif
-
- CopyFilesInCopyList
-
- ClearCopyList
-
- ''*******************************************
- '' modify .ini files to subsitute variables
- ''*******************************************
-
- IF INSMODE$ <> "ADMIN" THEN
- count% = 1
- inicur$ = GetNthFieldFromIniString( INIFILES$, count% )
-
- WHILE inicur$ <> ""
- '$ifdef DEBUG
- WriteToLogFile "Ini File: " + inicur$ + " of " + INIFILES$
- '$endif ''DEBUG
-
- index% = 1
- inikeys$ = GetIniKeyString( Ini$, INFO$, inicur$ + Str$(index%) )
-
- '$ifdef DEBUG
- WriteToLogFile "Getting " + inicur$ + Str$(index%)
- '$endif ''DEBUG
-
- WHILE inikeys$ <> ""
-
- '$ifdef DEBUG
- WriteToLogFile inicur$ + Str$(index%) + " = " + inikeys$
- '$endif ''DEBUG
-
- section$ = GetNthFieldFromIniString( inikeys$, 1 )
-
- IF section$ <> "" THEN
-
- keycount% = 2
- keycur$ = GetNthFieldFromIniString( inikeys$, keycount% )
-
- '$ifdef DEBUG
- WriteToLogFile inikey$ + Str$(keycount%) + " = " + keycur$
- '$endif ''DEBUG
-
- WHILE keycur$ <> ""
-
- keyval$ = GetIniKeyString( WINDIR$ + inicur$, section$, keycur$ )
-
-
- IF keyval$ <> "" THEN
-
-
- '$ifdef DEBUG
- WriteToLogFile "Old Ini Value in " + WINDIR$ + inicur$ + ": [" + section$ + "], " + keycur$ + " = " + keyval$ + " -->"
- '$endif ''DEBUG
-
- keyval$ = SubVariables( keyval$ )
- CreateIniKeyValue WINDIR$ + inicur$, section$, keycur$, keyval$, cmoOverwrite
-
- END IF
- keycount% = keycount% + 1
- keycur$ = GetNthFieldFromIniString( inikeys$, keycount% )
- WEND
-
- END IF
-
- index% = index% + 1
- inikeys$ = GetIniKeyString( Ini$, INFO$, inicur$+Str$(index%) )
-
- WEND
-
- count% = count% + 1
- inicur$ = GetNthFieldFromIniString( INIFILES$, count% )
- WEND
-
- END IF
-
- ''**************************
- '' Add Program Item
- ''**************************
-
- IF ADDGROUP$ = "ON" THEN
-
- IF INSMODE$ = "NETWORK" THEN
- ExeDir$ = SOURCE$
- ELSE
- ExeDir$ = DEST$
- END IF
-
- CreateProgmanGroup NEWGROUP$, "", cmoNone
- ShowProgmanGroup NEWGROUP$, 1, cmoNone
-
- count% = 1
- program$ = GetNthFieldFromIniString( ITEMEXE$, count% )
-
- WHILE program$ <> ""
-
- command$ = GetIniKeyString( Ini$, INFO$, program$ )
- itemname$ = GetNthFieldFromIniString( command$, 1 )
- option$ = GetNthFieldFromIniString( command$, 2 )
- iconname$ = GetNthFieldFromIniString( command$, 3 )
-
- IF iconname$ <> "" THEN
- iconidx$ = GetNthFieldFromIniString( command$, 4 )
-
- IF iconidx$ <> "" THEN
- iconname$ = iconname$ + "," + iconidx$
- iconx$ = GetNthFieldFromIniString( command$, 5 )
-
- IF iconx$ <> "" THEN
- iconname$ = iconname$ + "," + iconx$
- icony$ = GetNthFieldFromIniString( command$, 6 )
-
- IF icony$ <> "" THEN
- iconname$ = iconname$ + "," + icony$
- workdir$ = GetNthFieldFromIniString( command$, 7 )
-
- IF workdir$ <> "" THEN
- iconname$ = iconname$ + "," + workdir$
- END IF
-
- END IF
- END IF
- END IF
- END IF
-
- option$ = SubVariables( option$ )
- iconname$ = SubVariables( iconname$ )
- command$ = MakePath( ExeDir$, program$ ) + " " + option$
-
- CreateProgmanItem NEWGROUP$, itemname$, command$, iconname$, cmoOverwrite
-
- count% = count% + 1
- program$ = GetNthFieldFromIniString( ITEMEXE$, count% )
- WEND
-
- END IF
-
- ''**************************
- '' Add Path
- ''**************************
-
- IF ADDPATH$ = "ON" THEN
- GetLocalHardDrivesList "HardDrvs"
- drv$ = GetListItem("HardDrvs", 1) + ":\"
- IF DoesFileExist(drv$+"autoexec.bat", femExists ) THEN
- PrependToPath drv$+"autoexec.bat", drv$+"autex.tmp", DEST$, cmoNone
- RemoveFile drv$+"autoexec.old", cmoNone
- BackupFile drv$+"autoexec.bat", "autoexec.old"
- RenameFile drv$+"autex.tmp", "autoexec.bat"
- END IF
- END IF
-
-
- ''****************************************
- '' Close Log file
- ''****************************************
-
- '$IFDEF DEBUG
- CloseLogFile
- '$ENDIF
-
- END SUB
- ''*******************************************************
- ''GOTOs
- ''*******************************************************
-
- QUIT:
- ON ERROR GOTO ERRQUIT
-
- IF ERR = 0 THEN
- dlg% = EXITSUCCESS
- ELSEIF ERR = STFQUIT THEN
- dlg% = EXITQUIT
- ELSE
- dlg% = EXITFAILURE
- END IF
-
- QUITL1:
- sz$ = UIStartDlg(CUIDLL$, dlg%, "FInfo0DlgProc", 0, "")
- IF sz$ = "REACTIVATE" THEN
- GOTO QUITL1
- END IF
- UIPop 1
-
- END
-
- ERRQUIT:
- i% = DoMsgBox("Setup sources were corrupted, call (0865) 791346", "Setup Message", MB_OK+MB_TASKMODAL+MB_ICONHAND)
- END
-
-
- INFO1:
-
- DLGBX% = DLG_MINIMUM
-
- temp$ = UIStartDlg(CUIDLL$, DLGBX%, "FInfo0DlgProc", 0, "")
- IF temp$ = "REACTIVATE" THEN
- GOTO INFO1
- END IF
- UIPop 1
- RETURN
-
- INFO2:
-
- DLGBX% = DLG_STANDARD
-
- temp$ = UIStartDlg(CUIDLL$, DLGBX%, "FInfo0DlgProc", 0, "")
- IF temp$ = "REACTIVATE" THEN
- GOTO INFO2
- END IF
- UIPop 1
- RETURN
-
- INFO3:
- IF CMPCOPY$ = "OFF" THEN
- DLGBX% = DLG_DISABLED
- ELSE
- DLGBX% = DLG_COMPLETE
- END IF
-
- temp$ = UIStartDlg(CUIDLL$, DLGBX%, "FInfo0DlgProc", 0, "")
- IF temp$ = "REACTIVATE" THEN
- GOTO INFO3
- END IF
- UIPop 1
- RETURN
-
-
-
- ASKQUIT:
- temp$ = UIStartDlg(CUIDLL$, ASKQUIT, "FQuitDlgProc", 0, "")
-
- IF temp$ = "EXIT" THEN
- UIPopAll
- ERROR STFQUIT
- ELSEIF temp$ = "REACTIVATE" THEN
- GOTO ASKQUIT
- ELSE
- UIPop 1
- END IF
- RETURN
-
- TOOBIG:
- temp$ = UIStartDlg(CUIDLL$, TOOBIG, "FInfo0DlgProc", 0, "")
- IF temp$ = "REACTIVATE" THEN
- RecalcPath
- 'SetDriveStatus
- GOTO TOOBIG
- END IF
- UIPop 1
- RETURN